<template>
  <view class="pt-5" v-if="!info">
    <u-empty v-if="errMsg" :text="errMsg"></u-empty>
    <q-load-icon v-else></q-load-icon>
  </view>
  <view v-else class="pa-3">
    <detail-info :info="info" />

    <!-- <view class="pos-btm pos-f z-100 bg-cell">
      <view class="al-c pa-3">
        <span class="mr-auto">更多</span>
        <u-button type="warning" size="small" @click="onPay(it)">支付</u-button>
      </view>
      <u-safe-bottom />
    </view> -->
  </view>
</template>

<script>
import detailInfo from "./detail-info.vue";

export default {
  components: {
    detailInfo,
  },
  data() {
    return {
      info: null,
      errMsg: null,
    };
  },
  computed: {
    btn1Txt() {
      const { status } = this.info;
      if (status == 0) return "支付";
      // if(status == 1) return
    },
  },
  onLoad({ id }) {
    this.id = id;
    this.getInfo();
  },
  methods: {
    onBtn1() {},
    async getInfo() {
      try {
        // this.loading = true;
        const { data } = await uni.$api.get("/data/auth/item/trade_order", {
          params: {
            id: this.id,
          },
        });
        this.info = data;
      } catch (error) {
        this.errMsg = error.errMsg;
      }
    },
  },
};
</script>
